package com.hy.base;

/**
 * Created by chairal on 2017/6/25.
 * api返回结果统一序列化实体类
 */
public class ApiResult {

    private int status = -1;

    private String message;

    private Object data;

    ApiResult() {
    }

    ApiResult(int status, String message) {
        this.status = status;
        this.message = message;
    }

    ApiResult(int status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    public static ApiResult SUCCESS() {
        return new ApiResult(0, "SUCCESS");
    }

    public static ApiResult SUCCESS(Object data) {
        return new ApiResult(0, "SUCCESS", data);
    }

    public static ApiResult FAIL() {
        return new ApiResult(-1, "FAIL");
    }

    public static ApiResult FAIL(String message) {
        return new ApiResult(-1, message);
    }

    public static ApiResult FAIL(Object data) {
        return new ApiResult(-1, "FAIL", data);
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
